<template>
    <div>
      <el-card class="main_con">
        <span class="title">修改密码</span>
        <div class="content">
            <my-form v-model="form" ref="form" labelWidth='80px' @submit="submit" @cancle="cancle" >
                <el-row class="content_input">
                    <el-col :span="22">
                        <el-form-item label="旧密码" prop="oldPassword" :rules="newRule('旧密码', 'required')" >
                            <el-input v-model="form.oldPassword" show-password></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="22">
                        <el-form-item label="新密码" prop="newPassword" :rules="newRule('新密码', 'required')" >
                            <el-input v-model="form.newPassword" show-password></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <span slot="changename">返回</span>
            </my-form>
        </div> 
      </el-card>
    </div>
</template>

<script>

export default {
    components: {},
    props: {},
    data(){
        return{
            form:{
                newPassword:'',
                oldPassword:'',
            }
        }
    },
    computed: {

    },
    watch:{
    
    },
    methods: {
        submit:function(){
            this.$post('/bhtong/sysmg/user/changepwd',{
                newpwd:this.form.newPassword,
                oldpwd:this.form.oldPassword
            },function(data){
                this.form.newPassword = '';
                this.form.oldPassword = '';
                ShowMsg('密码修改成功','success');
            })
        },
        cancle:function(){
            this.$router.go(-1)
        },
  

    },
    mounted:function(){
        
    }
}
</script>

<style scoped lang="scss">
    .main_con{
        width: 600px;
        height: 340px;
        margin: 0 auto ;
    }
    .title{
        font-size: 18px;
    }
    .content{
        height: 100%;
        margin-top: 80px;
    }



</style>

